package chapter01;

import java.util.Scanner;

public class Test11_Day1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入年月");
        int year = scanner.nextInt();
        int month = scanner.nextInt();
        boolean flag = year%4==0&&year%100!=0||year%400==0;
        if(month==1||month==3||month==5||month==7||month==8||month==10||month==12){
            System.out.println("该月份为31天");
        } else if (month==4||month==6||month==9||month==11) {
            System.out.println("该月份为30天");
        } else if (month==2) {
            if(flag){
                System.out.println("该月份为29天");
            }else{
                System.out.println("该月份为28天");
            }
        }else{
            System.out.println("输入的月份格式不正确");
        }
    }
}
